home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / win32 / Ftsiface.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-08  |  6.6 KB  |  157 lines

  1. /*++
  2.  
  3. Copyright (c) 1993-1996  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     ftsiface.h
  8.  
  9. Abstract:
  10.  
  11.     Interface to the full text seach DLL (ftsrch.dll) distributed with WinHelp
  12.  
  13. Revision History:
  14.  
  15.     Introduced with Windows 95 and Windows NT 3.51
  16.  
  17. --*/
  18.  
  19. #ifndef __FTSIFACE_H__
  20. #define __FTSIFACE_H__
  21.  
  22. typedef HANDLE HINDEX;
  23. typedef HANDLE HSEARCHER;
  24. typedef HANDLE HCOMPRESSOR;
  25. typedef HANDLE HHILITER;
  26. typedef INT    ERRORCODE;
  27. typedef struct { int base; int limit; } HILITE;
  28.  
  29. #define NO_TITLE              UINT(-1)  // ERRORCODE values
  30. #define NOT_INDEXER           UINT(-2)
  31. #define NOT_SEARCHER          UINT(-3)
  32. #define NOT_COMPRESSOR        UINT(-4)
  33. #define CANNOT_SAVE           UINT(-5)
  34. #define OUT_OF_MEMORY         UINT(-6)
  35. #define CANNOT_OPEN           UINT(-7)
  36. #define CANNOT_LOAD           UINT(-8)
  37. #define INVALID_INDEX         UINT(-9)
  38. #define ALREADY_WEIGHED       UINT(-10)
  39. #define NO_TEXT_SCANNED       UINT(-11)
  40. #define ALIGNMENT_ERROR       UINT(-12)
  41. #define INVALID_PHRASE_TABLE  UINT(-13)
  42. #define INVALID_LCID          UINT(-14)
  43. #define NO_INDICES_LOADED     UINT(-15)
  44. #define INDEX_LOADED_ALREADY  UINT(-16)
  45. #define GROUP_LOADED_ALREADY  UINT(-17)
  46. #define DIALOG_ALREADY_ACTIVE UINT(-18)
  47. #define EMPTY_PHRASE_TABLE    UINT(-19)
  48. #define OUT_OF_DISK           UINT(-20)
  49. #define DISK_READ_ERROR       UINT(-21)
  50. #define DISK_WRITE_ERROR      UINT(-22)
  51. #define SEARCH_ABORTED        UINT(-23)
  52. #define UNKNOWN_EXCEPTION     UINT(-24)
  53. #define SYSTEM_ERROR          UINT(-25)
  54. #define NOT_HILITER              UINT(-26)
  55. #define INVALID_CHARSET       UINT(-27)
  56. #define INVALID_SOURCE_NAME   UINT(-28)
  57. #define INVALID_TIMESTAMP     UINT(-29)
  58.  
  59. // -------------- Index Construction Interface ---------------------------
  60.  
  61. #define TOPIC_SEARCH    0x00000001   // Options for NewIndex
  62. #define PHRASE_SEARCH   0x00000002
  63. #define PHRASE_FEEDBACK 0x00000004
  64. #define VECTOR_SEARCH   0x00000008
  65. #define WINHELP_INDEX   0x00000010
  66. #define USE_VA_ADDR     0x00000020
  67. #define USE_QWORD_JUMP  0x00000040
  68.  
  69. #define USE_DEFAULT     UINT(-1) // Surrogate for default charset or default lcid
  70.  
  71. extern "C" HINDEX APIENTRY NewIndex(const PBYTE pbSourceName,
  72.                            UINT uiTime1, UINT uiTime2,
  73.                            UINT iCharsetDefault, UINT lcidDefault, UINT fdwOptions                 
  74.                           );                                                     
  75.  
  76. extern "C" ERRORCODE APIENTRY ScanTopicTitle(HINDEX hinx, PBYTE pbTitle, UINT cbTitle, 
  77.                                     UINT iTopic, HANDLE hTopic, UINT iCharset, UINT lcid
  78.                                    );
  79. extern "C" ERRORCODE APIENTRY ScanTopicText (HINDEX hinx, PBYTE pbText, UINT cbText, UINT iCharset, UINT lcid);
  80. extern "C" ERRORCODE APIENTRY SaveIndex     (HINDEX hinx, PSZ pszFileName);
  81. extern "C" ERRORCODE APIENTRY DeleteIndex   (HINDEX hinx);
  82.  
  83. typedef void  (__stdcall *ANIMATOR)(void);
  84.  
  85. extern "C" ERRORCODE APIENTRY RegisterAnimator(ANIMATOR pAnimator, HWND hwndAnimator);
  86.  
  87. // ----------------- Querying the Validity of an Index File --------------
  88.  
  89. extern "C" BOOL      APIENTRY IsValidIndex(PSZ pszFileName, UINT dwOptions);
  90.  
  91. extern "C" void      APIENTRY SetDirectoryLocator(HWND hwndLocator);
  92.  
  93. // ----------------- Searcher Interface ----------------------------------
  94.  
  95. extern "C" HSEARCHER APIENTRY NewSearcher();                                          
  96.  
  97. extern "C" INT       APIENTRY OpenIndex(HSEARCHER hsrch, PSZ pszIndexFileName,        // returns iIndex for index file
  98.                                PBYTE pbSourceName, PUINT pcbSourceNameLimit, // or      -ErrorCode
  99.                                PUINT pTime1, PUINT pTime2
  100.                               );
  101.  
  102. extern "C" ERRORCODE APIENTRY DiscardIndex  (HSEARCHER hsrch, INT iIndex);
  103. extern "C" ERRORCODE APIENTRY QueryOptions  (HSEARCHER hsrch, INT iIndex, PUINT pfdwOptions);
  104. extern "C" ERRORCODE APIENTRY SaveGroup     (HSEARCHER hsrch, PSZ pszFileName);
  105. extern "C" ERRORCODE APIENTRY LoadGroup     (HSEARCHER hsrch, PSZ pszFileName);
  106. extern "C" HWND      APIENTRY OpenDialog    (HSEARCHER hsrch, HWND hwndParent);
  107. extern "C" ERRORCODE APIENTRY DeleteSearcher(HSEARCHER hsrch);
  108.  
  109. // Messages for talking to WinHelp
  110.  
  111. #define MSG_FTS_JUMP_HASH    (WM_USER + 32)  // wParam = index, lParam = HashValue
  112. #define MSG_FTS_JUMP_VA     (WM_USER + 33)  // wParam = index, lParam = VirtualAddress
  113. #define MSG_FTS_GET_TITLE    (WM_USER + 34)    // wParam = index, lParam = &pszTitle
  114. #define MSG_FTS_JUMP_QWORD  (WM_USER + 35)  // wParam = index, lParam = address of QWordAddress structure
  115. #define MSG_REINDEX_REQUEST (WM_USER + 36)  // wParam = unused,lParam = unused
  116. #define MSG_FTS_WHERE_IS_IT (WM_USER + 37)    // wParam = fStartEnumeration, lParam = &pszFile
  117. #define MSG_GET_DEFFONT     (WM_USER + 45)    // return default font handle
  118.  
  119. typedef struct _QWordAddress
  120.         {
  121.             UINT   iSerial;
  122.             HANDLE hTopic;
  123.  
  124.         } QWordAddress, *PQWordAddress;
  125.  
  126. // ------------------- Phrase Compression Interface ----------------------
  127.  
  128. extern "C" HCOMPRESSOR APIENTRY NewCompressor(UINT iCharsetDefault);
  129.  
  130. extern "C" ERRORCODE   APIENTRY ScanText(HCOMPRESSOR hcmp, PBYTE pbText, UINT cbText, UINT iCharset);
  131.  
  132. extern "C" ERRORCODE   APIENTRY GetPhraseTable(HCOMPRESSOR hcmp, PUINT pcPhrases, PBYTE *ppbImages, PUINT pcbImages,            
  133.                                       PBYTE *ppacbImageCompressed, PUINT pcbCompressed
  134.                                      );
  135.  
  136. extern "C" ERRORCODE   APIENTRY SetPhraseTable(HCOMPRESSOR hcmp, PBYTE pbImages, UINT cbImages,
  137.                                       PBYTE pacbImageCompressed, UINT cbCompressed
  138.                                      );
  139.  
  140. extern "C" INT APIENTRY CompressText  (HCOMPRESSOR hcmp, PBYTE pbText,       UINT cbText,       PBYTE *ppbCompressed, UINT iCharset);      
  141. extern "C" INT APIENTRY DecompressText(HCOMPRESSOR hcmp, PBYTE pbCompressed, UINT cbCompressed, PBYTE  pbText                      );
  142.  
  143. extern "C" ERRORCODE   APIENTRY DeleteCompressor(HCOMPRESSOR hcmp);
  144.  
  145. //----------------------- Hiliting Interface ------------------------------
  146.  
  147. extern "C" HHILITER APIENTRY NewHiliter(HSEARCHER hSearch);
  148. extern "C" ERRORCODE APIENTRY DeleteHiliter(HHILITER hhil);
  149. extern "C" ERRORCODE APIENTRY ScanDisplayText(HHILITER hhil, PBYTE pbText, int cbText, 
  150.                                                       UINT iCharset, LCID lcid);
  151. extern "C" ERRORCODE APIENTRY ClearDisplayText(HHILITER hhil);
  152. extern "C" int APIENTRY CountHilites(HHILITER hhil, int base, int limit);
  153. extern "C" int APIENTRY QueryHilites(HHILITER hhil, int base, int limit,
  154.                                                       int cHilites, HILITE* paHilites);
  155.  
  156. #endif // __FTSIFACE_H__
  157.